package com.example.administrator.uis.view

import android.content.Context
import android.graphics.Canvas
import android.graphics.Paint
import android.graphics.Path
import android.graphics.RectF
import android.os.Build
import android.support.annotation.RequiresApi
import android.util.AttributeSet
import android.view.View

/**
 * Created by Administrator on 2017/11/10 0010.
 */
class PracticeDrawPathView : View {
    constructor(context: Context?) : super(context) {
    }

    constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs) {
    }

    constructor(context: Context?, attrs: AttributeSet?, defStyle: Int) : super(context, attrs, defStyle) {

    }

    @RequiresApi(Build.VERSION_CODES.LOLLIPOP)
    override fun onDraw(canvas: Canvas?) {
        super.onDraw(canvas)
        var paint = Paint()
        var path = Path()
//        path.addArc(200f, 200f, 400f, 400f, -225f, 225f)
//       path.arcTo(400f, 200f, 600f, 400f, -180f, 225f, false)
//        path.lineTo(400f, 542f)
//        paint.style=Paint.Style.STROKE
        path.lineTo(50f,50f)

        canvas?.drawPath(path, paint)
    }

}